;; ---------- ---------- ---------- ---------- ---------- ---------- ----------
;; Acknowledgements: https://www.emacswiki.org/emacs/ErcSSL
;; NOTE: According to the site, erc-tls might actually work properly now.
;;
;; TODO: Remove the example channels and make them dynamic.
;;       http://mwolson.org/static/doc/erc.html#Getting-Started
;;       Use ~/.emacs.d/.ercrc.el instead.
;;
;; ---------- ---------- ---------- ---------- ---------- ---------- ----------

(require 'erc)
(require 'tls)
(require 'erc-services)
(erc-services-mode 1)

(setq erc-nick-uniquifier "_")
(setq erc-nickserv-identify-mode 'autodetect)
(setq erc-prompt-for-nickserv-password nil)

(setq erc-id-nickone-pass nil)
(setq freeChannels nil)
(if (file-readable-p "~/.ercpass")
    (progn (load "~/.ercpass")))

(defun erc-freenode (nick)
  "erc-tls to irc.freenode.net"
  (interactive "sEnter your nick for freenode: ")
  (erc-tls :server "irc.freenode.net"
	   :port 6697
	   :nick nick)
  (setq erc-autojoin-timing 'ident)
  (erc-nickserv-identify erc-id-nickone-pass)
  (setq erc-autojoin-channels-alist (append freeChannels
					    erc-autojoin-channels-alist)))

(provide 'protoculture-erc)
